const Koa = require('koa')
const _ = require('koa-route')
const bodyParser = require('koa-bodyparser');

const app = new Koa()
app.use(bodyParser());

// #1
app.use(_.get('/v:version/test-api', require('./problem/first')))

// #2 & #3
const second_and_third_controller = require('./problem/second_and_third')
app.use(_.all('/v:version/arithmetic/:action', second_and_third_controller))
app.use(_.all('/v:version/:action', second_and_third_controller))

// #4
app.use(_.get('/:namespace/:resource/:action', require('./problem/fouth')))

// # 5
app.use(_.post('/user/:userId/wallet/self/detail', require('./problem/fifth')))

app.listen(12321)